]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Only create GDM client once
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 13 Feb 2020 20:36:51 +0000 (17:36 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 13 Feb 2020 21:11:09 +0000 (18:11 -0300)
We don't need to create a new one every time we create an
auth prompt.

Create only one GDM client.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/999

js/ui/unlockDialog.js

index 0ca62430ccc3456ce84a3e7deeefcc6f3a7d00b2..dd6f971cffc3fca1134e122c43c8f065f7a2e043 100644 (file)
@@ -465,6 +465,8 @@ var UnlockDialog = GObject.registerClass({
 
         parentActor.add_child(this);
 
+        this._gdmClient = new Gdm.Client();
+
         this._adjustment = new St.Adjustment({
             lower: 0,
             upper: 2,
@@ -615,7 +617,8 @@ var UnlockDialog = GObject.registerClass({
         if (this._authPrompt)
             return;
 
-        this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
+        this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient,
+            AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
         this._authPrompt.connect('failed', this._fail.bind(this));
         this._authPrompt.connect('cancelled', this._fail.bind(this));
         this._authPrompt.connect('reset', this._onReset.bind(this));
@@ -765,6 +768,11 @@ var UnlockDialog = GObject.registerClass({
             themeContext.disconnect(this._scaleChangedId);
             delete this._scaleChangedId;
         }
+
+        if (this._gdmClient) {
+            this._gdmClient = null;
+            delete this._gdmClient;
+        }
     }
 
     cancel() {